package dk.itu.spvc.tourtracker.gui;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import dk.itu.spvc.tourtracker.service.ServiceLocalSQL;

public class CreateTripActivity extends Activity implements OnClickListener {

	ServiceLocalSQL srvc_local = new ServiceLocalSQL(this);
	EditText tripName;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.create_trip);
	}

	@Override
	protected void onStart() {
		super.onStart();

		((Button) findViewById(R.id.CreateTripButton)).setOnClickListener(this);
		tripName = (EditText) findViewById(R.id.TripNameEditText);

	}

	public void onClick(View v) {
			
		this.setResult(RESULT_OK, new Intent().putExtra("tripName", tripName.getText().toString()));		
		
		finish();
	}

}
